package fraction;

import java.util.Stack;

public class Solution {
    public int[] fraction(int[] cont) {
        // 模拟
        int a = cont[cont.length-1];
        int b = 1;   // 分母
        for (int i = cont.length-2; i >=0 ; i--) {
            int t = a;
            a = b + cont[i]*a;
            b = t;
        }
        return new int[]{a,b};
    }
}
